home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-09-24 | 3.3 KB | 171 lines | [TEXT/CWIE] |
- // COPYRIGHT 1994 A.D. Software, All rights reserved
-
- // OOFILE database numeric fields
-
- // inline definitions
-
-
- // -------------------------------------------------------
- // d b S h o r t
- // -------------------------------------------------------
- inline dbShort& dbShort::operator=(long rhs)
- {
- #ifdef OOF_Debug
- CheckRange(rhs, SHRT_MIN, SHRT_MAX, __FILE__, __LINE__);
- #endif
- *this = (short)rhs;
- return *this;
- }
-
-
- inline dbShort& dbShort::operator=(int rhs) // assume same as long
- {
- #ifdef OOF_Debug
- CheckRange((long)rhs, SHRT_MIN, SHRT_MAX, __FILE__, __LINE__);
- #endif
- *this = (short)rhs;
- return *this;
- }
-
-
- inline dbShort& dbShort::operator=(double rhs)
- {
- #ifdef OOF_Debug
- CheckRange(rhs, SHRT_MIN, SHRT_MAX, __FILE__, __LINE__);
- #endif
- *this = (short)rhs;
- return *this;
- }
-
-
- inline ostream& operator<<(ostream& os, dbShort& fld)
- {
- fld.extract(os);
- return os;
- }
-
-
- // -------------------------------------------------------
- // d b U s h o r t
- // -------------------------------------------------------
- inline dbUshort& dbUshort::operator=(long rhs)
- {
- #ifdef OOF_Debug
- CheckRange(rhs, USHRT_MAX, __FILE__, __LINE__);
- #endif
- *this = (unsigned short)rhs;
- return *this;
- }
-
-
- inline dbUshort& dbUshort::operator=(int rhs) // assume same as long
- {
- #ifdef OOF_Debug
- CheckRange((unsigned long)rhs, USHRT_MAX, __FILE__, __LINE__);
- #endif
- *this = (unsigned short)rhs;
- return *this;
- }
-
-
- inline dbUshort& dbUshort::operator=(double rhs)
- {
- #ifdef OOF_Debug
- CheckRange((unsigned long)rhs, USHRT_MAX, __FILE__, __LINE__);
- #endif
- *this = (unsigned short)rhs;
- return *this;
- }
-
-
- inline ostream& operator<<(ostream& os, dbUshort& fld)
- {
- fld.extract(os);
- return os;
- }
-
-
- // -------------------------------------------------------
- // d b L o n g
- // -------------------------------------------------------
- inline dbLong& dbLong::operator=(int rhs)
- {
- *this = (long)rhs;
- return *this;
- }
-
-
- inline dbLong& dbLong::operator=(double rhs)
- {
- #ifdef OOF_Debug
- CheckRange(rhs, LONG_MIN, LONG_MAX, __FILE__, __LINE__);
- #endif
- *this = (long)rhs;
- return *this;
- }
-
-
- inline ostream& operator<<(ostream& os, dbLong& fld)
- {
- fld.extract(os);
- return os;
- }
-
-
- // -------------------------------------------------------
- // d b U l o n g
- // -------------------------------------------------------
- inline dbUlong& dbUlong::operator=(unsigned int rhs)
- {
- #ifdef OOF_Debug
- CheckRange(rhs, ULONG_MAX, __FILE__, __LINE__);
- #endif
- *this = (unsigned long)rhs;
- return *this;
- }
-
-
- inline dbUlong& dbUlong::operator=(double rhs)
- {
- #ifdef OOF_Debug
- CheckRange((unsigned long)rhs, ULONG_MAX, __FILE__, __LINE__);
- #endif
- *this = (unsigned long)rhs;
- return *this;
- }
-
-
- inline ostream& operator<<(ostream& os, dbUlong& fld)
- {
- fld.extract(os);
- return os;
- }
-
-
- // -------------------------------------------------------
- // d b D a t e
- // -------------------------------------------------------
- inline ostream& operator<<(ostream& os, dbDate& fld)
- {
- fld.extract(os);
- return os;
- }
-
-
- inline void dbDate::setString(const char* str)
- {
- dbDate::operator=(str);
- }
-
-
- // -------------------------------------------------------
- // d b R e a l
- // -------------------------------------------------------
- inline ostream& operator<<(ostream& os, dbReal& fld)
- {
- fld.extract(os);
- return os;
- }
-
-
-